<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .box {
            width: 296px;
            height: 198px;
            overflow: hidden;
            position: relative;
            margin: 20px auto;
        }
        .mark {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            color: #fff;
            text-align: center;
            display: flex;
            justify-content: center;
            align-items: center;
            transform: translateY(148px);
            transition: 500ms;
        }
        .content {
            transform: translateY(-65px);
            transition: 500ms;
        }
        .content h1 {
            font-size: 18px;
            font-weight: normal;
            height: 50px;
            line-height: 50px;
        }
        .content p {
            font-size: 14px;
        }
        /* hover 显示遮罩 */
        .box:hover .mark {
            transform: translateY(0);
        }
        .box:hover .content {
            transform: translateY(0);
        }
    </style>
</head>
<body>
    <div class="box">
        <img src="./img/01.jpg" alt="">
        <!-- 遮罩 -->
        <div class="mark">
            <div class="content">
                <h1>职业技能</h1>
                <p>传授前端开发工程师等各类技能学习宝典</p>
            </div>
        </div>
    </div>
</body>
</html>